<template>
	<view class="about">
		<h1>姓名：{{userInfo.name}}</h1>
		<h1>年龄：{{newAge}}</h1>
		<button @click="changname()">修改name</button>
	</view>
</template>

<script>
	export default {
		computed: {
			userInfo() {
				return this.$store.state.userInfo
			},
			newAge(){
				return this.$store.getters.userInfoNewAge
			}
			
		},
		methods: {
			changname(){
				this.$store.commit('userInfo',{name:'小猪',age:18})
			},
			
		}
	}
</script>